package com.patttern.behavior.observer;

import java.util.Observable;

/**
 * @Author: root
 * @Date: 2018/12/3 21:00
 */
public class SubjectA extends Observable {
    private int state;

    public SubjectA() {

    }

    public SubjectA(int state) {
        this.state = state;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
        setChanged();
        notifyObservers(state);
    }
}
